



function Can_Hero()
{
	Can_Array.apply(this, arguments);
}
extend_usemid(Can_Hero, Can_Array);


Can_Hero.prototype.allotInstance = function(amount)
{
	for(var i = 0; i < amount; i++)
	{
		var _obj = new Hero_Normal();
		this.datas.push(_obj);
	}
}

Can_Hero.prototype.initPostion_allotHero = function()
{
	this.datas[0].position = new Position_Normal(233, 175);
	this.datas[1].position = new Position_Normal(319, 175);
	this.datas[2].position = new Position_Normal(396, 175);
	this.datas[3].position = new Position_Normal(482, 175);
	this.datas[4].position = new Position_Normal(566, 175);
}







function Hero_Info()
{
	this.self_w = 80;
	this.self_h = 117;
}

/**
 * 初始化一切绘图需要的信息
 */
Hero_Info.prototype.init = function()
{
}

function Hero_Base(a_id, a_factid)
{
	// 都继承fact_game对象
	Fact_Game.apply(this, arguments);
	// 武将名
	this.hero_name = null;
	// 阵营
	this.camp = null;
	// 是否是主公武将
	this.ismaster;
	// 血量
	this.hp = null;
	// 性别
	this.sex = null;
	//
	this.fact_info = new Hero_Info();
}
extend_usemid(Hero_Base, Fact_Game);


/**
 * 添加绘图
 */
Hero_Base.prototype.addSelfResource = function(number, position)
{
	var _position = null;
	var _x = position.x + 43;
	// 增加自己的绘图资源 相对于传进的position做偏移
	if (number == 0)
	{
		_position = new Position_Normal(_x + (number * this.fact_info.self_w),
				position.y + 60);
	}
	else
	{
		_position = new Position_Normal(_x + (number * (this.fact_info.self_w + 6)),
				position.y + 60);
	}

	Fact_Game.prototype.addSelfResource.apply(this, [ this.role_name,
			this.camp, _position ]);
	console.log(this);
}

/**
 * 武将
 * @returns
 */
function Hero_Normal(a_id, a_factid)
{
	Hero_Base.apply(this, arguments);
	this.view_priority = 4;
	this.hero_avatar = null;
}
extend_usemid(Hero_Normal, Hero_Base);

/**
 * 刘备
 * 
 * @returns
 */
function Hero_LiuBei()
{
	Hero_Normal.apply(this, [1, "Hero_LiuBei"]);
	this.role_name = "刘备";
	this.camp = "蜀";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/liubei.jpg";
}
extend_usemid(Hero_LiuBei, Hero_Normal);

/**
 * 张飞
 * 
 * @returns
 */
function Hero_ZhangFei()
{
	Hero_Normal.apply(this, [1, "Hero_ZhangFei"]);
	this.role_name = "张飞";
	this.camp = "蜀";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/zhangfei.jpg";
}
extend_usemid(Hero_ZhangFei, Hero_Normal);

/**
 * 司马懿
 * 
 * @returns
 */
function Hero_SiMaYi()
{
	Hero_Normal.apply(this, [1, "Hero_SiMaYi"]);
	this.role_name = "司马懿";
	this.camp = "魏";
	this.hp = 3;
	this.imagesrc = "media/images/fact/hero/card/simayi.jpg";
}
extend_usemid(Hero_SiMaYi, Hero_Normal);

/**
 * 赵云
 * 
 * @returns
 */
function Hero_ZhaoYun()
{
	Hero_Normal.apply(this, [1, "Hero_ZhaoYun"]);
	this.role_name = "司马懿";
	this.camp = "魏";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/zhaoyun.jpg";
}
extend_usemid(Hero_ZhaoYun, Hero_Normal);

/**
 * 魏延
 * 
 * @returns
 */
function Hero_WeiYan()
{
	Hero_Normal.apply(this, [1, "Hero_WeiYan"]);
	this.role_name = "司马懿";
	this.camp = "魏";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/weiyan.jpg";
}
extend_usemid(Hero_WeiYan, Hero_Normal);

/**
 * 马超
 * 
 * @returns
 */
function Hero_MaChao()
{
	Hero_Normal.apply(this, [1, "Hero_MaChao"]);
	this.role_name = "司马懿";
	this.camp = "魏";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/machao.jpg";
}
extend_usemid(Hero_MaChao, Hero_Normal);

/**
 * 吕蒙
 * 
 * @returns
 */
function Hero_LvMeng()
{
	Hero_Normal.apply(this, [1, "Hero_LvMeng"]);
	this.role_name = "司马懿";
	this.camp = "魏";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/lvmeng.jpg";
}
extend_usemid(Hero_LvMeng, Hero_Normal);

/**
 * 关羽
 * 
 * @returns
 */
function Hero_GuanYu()
{
	Hero_Normal.apply(this, [1, "Hero_GuanYu"]);
	this.role_name = "关羽";
	this.camp = "蜀";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/guanyu.jpg";
}
extend_usemid(Hero_GuanYu, Hero_Normal);

/**
 * 孙权
 * 
 * @returns
 */
function Hero_SunQuan()
{
	Hero_Normal.apply(this, [1, "Hero_SunQuan"]);
	this.role_name = "孙权";
	this.camp = "吴";
	this.hp = 4;
	this.imagesrc = "media/images/fact/hero/card/sunquan.jpg";
}
extend_usemid(Hero_SunQuan, Hero_Normal);
